<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="stylesheet" href="/res/layui/css/layui.css" type="text/css">
    <link rel="stylesheet" href="/res/css/global.css"  type="text/css">
    <script src="/res/layui/layui.js" type="text/javascript"></script>
    <script src="/js/jquery-1.11.3.min.js"  type="text/javascript"></script>
    <script src="/myplugs/js/plugs.js"  type="text/javascript"></script>



    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
            crossorigin="anonymous"></script>
</head>

<style>
    .icon{
        font-size: 20px;
        position: relative;
        top: 10%;
        text-align: center;
    }

</style>

<body>
<cite th:text="${session.id}" id="uid" hidden="hidden"></cite>
<div class="header">
    <div class="main">
        <a style="margin-left: 30px;line-height: 65px; color: white;font-size: 18px;">跨境电商借卖平台--品牌商</a>
        <div class="nav"></div>
        <div class="nav-user">
            <!-- 登入后的状态 -->
            <a class="avatar" th:href="@{/login}">
                <img th:src="@{/res/images/8.jpg}">
                <cite style="color: white;" th:text="${session.name}"></cite>
                <i style="color: white;" id="logout">退出</i>
            </a>
        </div>
    </div>
</div>


<div class="main fly-user-main layui-clear">
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">

        <li class="layui-nav-item "><a href="#" target="right" id="role" style=" font-size: 18px;text-decoration:none;"> <!--<i
                class="layui-icon">&#xe612;</i> 公司信息</a></li>-->
        <span class="glyphicon glyphicon-user icon"></span> &nbsp;&nbsp;公司信息 </a></li>


        <li class="layui-nav-item "><a href="#" target="right" id="user" style=" font-size: 18px;text-decoration:none;">
            <!--<i class="layui-icon">&#xe612;</i> 品牌管理</a></li>-->
            <span class="glyphicon glyphicon-th icon"></span> &nbsp;&nbsp;品牌管理 </a></li>


        <li class="layui-nav-item"><a href="#" target="right" id="newsType" style=" font-size: 18px;text-decoration:none;">
        <!--<i class="layui-icon">&#xe612;</i> 商品入库 </a></li>-->
            <span class="glyphicon glyphicon-save icon"></span> &nbsp;&nbsp;商品入库 </a></li>


        <li class="layui-nav-item "><a href="#" target="right" id="news" style=" font-size: 18px;text-decoration:none;">
            <!--<i class="layui-icon">&#xe612;</i> 商品管理</a></li>-->
            <span class="glyphicon glyphicon-edit icon"></span> &nbsp;&nbsp;商品管理 </a></li>


        <li class="layui-nav-item  "><a href="#" target="right" id="login" style=" font-size: 18px;text-decoration:none;">
        <!--<i class="layui-icon">&#xe612;</i> 订单管理 </a></li>-->
            <span class="glyphicon glyphicon-list-alt icon"></span> &nbsp;&nbsp;订单管理 </a></li>


        <li class="layui-nav-item  "><a href="#" target="right" id="wallet" style=" font-size: 18px;text-decoration:none;">
        <!--<i class="layui-icon">&#xe612;</i> 我的钱包 </a></li>-->
            <span class="glyphicon glyphicon-usd icon"></span> &nbsp;&nbsp;我的钱包 </a></li>
    </ul>

    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>

    <div class="fly-panel fly-panel-user">
        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <div class="layui-tab-content" style="padding: 20px;padding-top: 0px;">
                <iframe src="" width="88%" style="border: none;overflow: hidden;" height="800" border="none"
                        name="right" id="first"></iframe>
            </div>
        </div>
    </div>
</div>
</div>
</body>

<script type="text/javascript">
    var mvo_id=$("#uid").text();

    $(function () {

        //将需要修改信息的商品ID传到该页面
        $("#first").attr('src', '/mvocompany?uid='+mvo_id);
        $("#role").attr('href','/mvocompany?uid='+mvo_id);
        $("#user").attr('href','/mvobrand?uid='+mvo_id);
        $("#newsType").attr('href','/mvouploadgoods?uid='+mvo_id);
        $("#news").attr('href','/mvogoods?uid='+mvo_id);
        $("#login").attr('href','/mvoorder?uid='+mvo_id);
        wallet();
    })


    //判断该账户钱包是否注册
    function wallet() {
        $.ajax({
            type: 'post',
            url: '/wallet/selectMyWalletByUid',
            data: {uid: mvo_id},
            dataType: 'text',
            success: function (mydata) {
                if(mydata=="true"){
                    //跳转到钱包页面
                    $("#wallet").attr('href','/mvowalletInfo?uid='+mvo_id);
                }else{
                    //跳转到钱包注册页面
                    $("#wallet").attr("href", "/mvoregisterWallet?uid=" + mvo_id);
                }
            },
            error: function () {
                //跳转到钱包注册页面
                $("#wallet").attr("href", "/mvoregisterWallet?uid=" + mvo_id);
            }
        })
    }


    //退出登录
    $("#logout").click(function(){
        $.ajax({
            type:"post",
            url: "/login/logout",
            data:{},
            dataType:"text",
            success:function () {
                alert("登出成功!");
                window.location.href = "/login";
            },
            error:function () {
                alert("失败!");
            }
        })
    })
</script>
</html>